class Person {
    name: string
    age: number
    constructor(name: string, age: number) {
        this.name = name
        this.age = age
    }
    sayName(): void {
        console.log(this.name);
    }
}

class Student extends Person {
    skill: string
    constructor(name: string, age: number, skill: string) {
        super(name, age)
        this.skill = skill
    }
    getSkill(): void {
        console.log(this.skill);
    }
}

var s: Student = new Student("lisi", 18, "web");
var p: Person = new Person('wangwu', 19);
s.sayName();
s.getSkill();
//p.getSkill();     父类不能调用子类方法